<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>WISSC轮滑教培服务网-查询系统</title>
<#assign base=request.contextPath  />
    <link rel="icon" href="${base}/favicon.ico">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${base}/frame/layui/css/layui.css" media="all">
    <script type="text/javascript" src="${base}/js/feng.js"></script>
    <script src="${base}/js/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/css/hzw-city-picker.css">
    <script type="text/javascript" src="${base}/js/city-data.js"></script>
    <script type="text/javascript" src="${base}/js/hzw-city-picker.min.js"></script>
    <script src="${base}/frame/layui/layui.all.js"></script>


</head>
<style>
    tr{
        margin: 0;
        padding: 5px 0;
    }
    td{
        min-width: 40px;
    }
</style>
<body>

<div style="background-color: #A60000; margin-bottom: 10px;">
    <i class="layui-icon layui-icon-shrink-right"  style="color: white">&nbsp;&nbsp;&nbsp;&nbsp;战队信息</i>
</div>
<div overflow="hidden">
    <div  id="url"  style="margin-left:100px; float: left"></div>
    <div  style="margin-left: 20px; float: left" >
        <table class="layui-table" lay-even="" lay-skin="nob" lay-size="">
            <colgroup>
                <col width="150">
                <col width="150">
                <col width="150">
                <col width="150">
                <col width="150">
            </colgroup>
            <thead>
            <tr>
                <th>战队名称</th>
                <th id="teamName">${model.teamName}</th>
                <td></td>
                <td></td>
                <td></td>
                <th></th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>所属地区</td>
                <td id="city">${model.city}</td>

                <td>建队时间</td>
                <td id="buildingTime">${data}</td>

                <td>队  龄</td>
                <td id="age">${model.year}年</td>

            </tr>
            <tr>
                <td>战队积分</td>
                <td id="teamIntegral">${model.c}分</td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>


            </tr>
            <tr>
                <td>战队城市排名</td>
                <td id="cityRanking" style="color: red">${county2}位</td>

                <td>战队省份排名</td>
                <td id="provinceRanking" style="color: red">${county1}位</td>

                <td>战队国家排名</td>
                <td id="nationalRanking" style="color: red">${county}位</td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<hr>
<div style="background-color:  #A60000">

    <i class="layui-icon layui-icon-shrink-right"  style="color: white">&nbsp;&nbsp;&nbsp;&nbsp;赛事经历</i>
</div>
<table  class="layui-hide" id="event"></table>

<button class="layui-btn" lay-submit lay-filter="formDemo" type="button"
       id="abc" style="background-color: #0092EF;">生成海报

<script>

    $('#abc').on('click',function () {
        var sum = "战队名称："+$("#teamName").text()+
            ", 所属地区："+$("#city").text()+
            ", 建队时间："+$("#buildingTime").text()+
            ", 队龄："+$("#age").text()+
            ", 战队积分："+$("#teamIntegral").text()+
            ", 战队城市排名："+$("#cityRanking").text()+
            ", 战队省份排名："+$("#provinceRanking").text()+
            ", 战队国家排名："+$("#nationalRanking").text();

        window.location.href = "${base}/team/getPoster?sum="+sum+"&teamName="+"${teamName}";
    });
</script>
<script>

    window.onload=function () {
        $.ajax({
            url:"${base}/team/land?teamName=${teamName}",
            type: "GET",   //请求方式
            async:false,
            success: function (data) {


                $("#url").html(
                        '<img src="${base}/team/getPhoto?path=' + data[0].teamLogo + '" style="width: 130px;height: 130px; position: relative; top: 16px;right:45px; ">'
                );

                 /*$("#teamName").append(data[0].teamName);
                $("#city").append(data[0].city);
                $("#buildingTime").append(DateFormat(data[0].buildingTime));
                $("#city").append(data[0].city);
                $("#age").append(data[0].age);
                $("#teamIntegral").append(data[0].teamIntegral); */


            }
        })

    }
</script>

<script>

    layui.use('table', function(){
        var table = layui.table;

        table.render({
            elem: '#event'
            ,height: 250
            ,url:'${base}/team/selectTeamName?teamName=${teamName}'
            ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            ,cols: [[
                {field:'matchTime',  title: '赛事时间', templet: function (val) {
                    return DateFormat(val.matchTime);
                }, align: 'center'}
                ,{field:'matchName', title: '赛事名称', align: 'center'}
                ,{field:'integral', title: '积分', align: 'center'}

            ]]
            , page: {
                layout: ['limit', 'count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
                , theme: '#0092EF'
                , limit: 10
            }

        });
    });


</script>
</body>
</html>